package com.cat.dynamicPlanning02;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/problems/find-triangular-sum-of-an-array/?envType=daily-question&envId=2025-09-30
 * @create 2025/9/30 15:35
 * @since JDK17
 */

public class Solution08 {
    public int triangularSum(int[] nums) {
        int n = nums.length;
        for (int i = 1; i < n; i++) {
            for (int j = 0; j < n - i; j++) {
                nums[j] = (nums[j] + nums[j + 1]) % 10;
            }
        }
        return nums[0];
    }
}
